package edu.zut.dao;

import edu.zut.util.DBUtil;

import java.sql.ResultSet;
import java.sql.SQLException;

//针对用户操作的数据层（类）
public class UserDao {

    //表示用户登录的查询操作
    public boolean userLogin(String user_name, String user_psw) {

        String sql = "select * from sys_user where user_name =? and user_password = ?";
        ResultSet rs = DBUtil.query(sql, user_name, user_psw);
        boolean flag = false;
        try {
            if (rs.next()){
                flag = true;
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return flag;
    }

}
